package com.twetec.cms.dao.mapper.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.twetec.cms.model.po.system.CmsMenuPO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: zhaichangzheng
 * @Date: 2022/2/8 14:38 （日期和时间）
 */
public interface CmsMenuMapper extends BaseMapper<CmsMenuPO> {

    @Select("SELECT DISTINCT CMS_MENU.ID,CMS_MENU.PID,CMS_MENU.PIDS, CMS_MENU.NAME,CMS_MENU.PERMISSION,CMS_MENU.SORT,\n" +
            "CMS_MENU.REMARK,CMS_MENU.GMT_CREATE,CMS_MENU.CREATOR_ID,CMS_MENU.GMT_MODIFIED,CMS_MENU.IS_DELETED,\n" +
            "CMS_MENU.SITE_ID,CMS_MENU.COLUMN_ID,CMS_MENU.IS_RECOVERY,CMS_MENU.TYPE \n" +
            "FROM CMS_ROLE_MENU LEFT JOIN CMS_MENU ON CMS_MENU.ID = CMS_ROLE_MENU.MENU_ID \n" +
            "  ${ew.customSqlSegment}")
    public List<CmsMenuPO> selectRoleMenu(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
}


